import URL from '@/config/url'
import utils from '@/utils/utils'

export default {
	// 银行名称列表
	GetBankZhInfo(params = {}) {
		let data = {
			BANKCODE: params.BANKCODE,
			PROVINCE_CODE: params.PROVINCE_CODE,
			AREA: params.AREA
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/base/BankCard/getBankZhInfo',
			data
		})
	},
	// 银行名称列表
	GetBankName(params = {}) {
		let data = {
			BAF_NAME: params.BAF_NAME
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/base/BankCard/getBankName',
			data
		})
	},
	// 会员签约参数获取
	SignContract(params = {}) {
		let data = {
			jumpPageType: params.jumpPageType,
			jumpUrl: params.jumpUrl,
			noContractUrl: params.noContractUrl
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/base/BankCard/signContract',
			data
		})
	},
	// 解绑银行卡
	DelBankCard(params = {}) {
		let data = {
			card_id: params.card_id,
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/base/BankCard/unbindBankCard',
			data
		})
	},
	// 获取银行卡列表
	GetBankCardList(params = {}) {
		let data = {
			page: params.page,
			pagesize: 10,
			level:params.level
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/base/BankCard/getList',
			data
		})
	},
	// 绑定手机号码
	SetbindPhone(params = {}) {
		let data = {
			phone: params.phone,
			sms_code: params.sms_code
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/base/BankCard/bindPhone',
			data
		})
	},
	// 获取绑定手机验证码
	sendVerificationCode(params = {}) {
		let data = {
			phone: params.phone,
		}
		console.log(data);
		return utils.uniRequest({
			url: URL.BASE2 + '/base/BankCard/sendVerificationCode',
			data
		})
	},

	// 确认绑定银行卡
	bindBankCard(params = {}) {
		let data = {
			account_type: params.account_type,
			bank_name: params.bank_name,
			bank_branch_name: params.bank_branch_name,
			card_no: params.card_no,
			card_type: params.card_type,
			phone: params.phone,
			sms_code: params.sms_code,
			trance_num: params.trance_num,
			trans_date: params.trans_date,
			bank_code: params.bank_code,
			bank_prov: params.bank_prov,
			bank_city:params.bank_city,
			bank_pay_code:params.bank_pay_code
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/base/BankCard/bindBankCard',
			data
		})
	},

	// 请求绑定银行卡(获取取验证码)
	GetBindBankCard(params = {}) {
		let data = {
			card_no: params.card_no,
			phone: params.phone,
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/base/BankCard/applyBindBankCard',
			data
		})
	},

	// 查询云商通账户信息
	GetAccountMes(params = {}) {
		let data = {}
		return utils.uniRequest({
			url: URL.BASE2 + '/base/BankCard/getAccountInfo',
			data
		})
	},
	// 个人实名认证
	setRealName(params = {}) {
		let data = {
			// user_id:'ryz_11',
			name: params.name,
			id_no: params.id_no,
			identityBeginDate: params.identityBeginDate,
			identityEndDate: params.identityEndDate,
			address: params.address,
			professionNo: params.professionNo,
			idCard_front_img_id: params.idCard_front_img_id,
			idCard_back_img_id: params.idCard_back_img_id
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/base/BankCard/setRealName',
			data
		})
	},
	// 企业实名认证
	setCompanyInfo(params = {}) {
		let data = {
			// user_id:'ryz_11',
			authType: params.authType,
			company_name: params.company_name,
			identityBeginDate: params.identityBeginDate,
			legal_name: params.legal_name,
			identity_type: params.identity_type,
			legal_ids: params.legal_ids,
			legal_phone: params.legal_phone,
			account_no: params.account_no,
			parent_bank_name: params.parent_bank_name,
			bank_name: params.bank_name,
			union_bank: params.union_bank,
			uniCredit: params.uniCredit,
			businessLicense: params.businessLicense,
			organizationCode: params.organizationCode,
			taxRegister: params.taxRegister,
			businessLicense_img_id: params.businessLicense_img_id,
			organizationCode_img_id: params.organizationCode_img_id,
			taxRegister_img_id: params.taxRegister_img_id,
			bankAccCert_img_id: params.bankAccCert_img_id,
			idCard_front_img_id: params.idCard_front_img_id,
			idCard_back_img_id: params.idCard_back_img_id

		}
		return utils.uniRequest({
			url: URL.BASE2 + '/base/BankCard/setCompanyInfo',
			data
		})
	},
	// 查询卡bin
	GetBinName(params = {}) {
		let data = {
			card_no: params.card_no
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/base/BankCard/getBankCardBin',
			data
		})
	},
	// 是否实名
	checkRealName(params = {}) {
		let data = {}
		return utils.uniRequest({
			url: URL.BASE2 + '/base/BankCard/getAccountInfo',
			data
		})
	},
	// 身份证识别
	GetBankCardOCR(params = {}) {
		let data = {
			img_id: params.img_id,
			card_side: params.card_side
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/base/Ocr/iDCardOCR',
			data
		})
	},
	// 营业执照识别
	GetbizLicenseOCR(params = {}) {
		let data = {
			img_id: params.img_id
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/base/Ocr/bizLicenseOCR',
			data
		})
	},
	// 营业执照识别
	GetorgCodeCertOCR(params = {}) {
		let data = {
			img_id: params.img_id
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/base/Ocr/orgCodeCertOCR',
			data
		})
	},

}
